import { Component, ReactNode } from "react";
import {Modal}from 'antd'
import EditUsersFrom from './EditUsersFrom'

interface EditUsersFormProps {
    visible?: boolean;
    closeModal: () => void; // 将closeModal方法作为props传递给子组件
    data:any;
  }
  
class EditUesrs extends Component<EditUsersFormProps> {
    
  render() {
    return( 
        <div>
            <Modal
             width='800px'
             visible={this.props.visible}
             title="编辑商品"
             onCancel={() => this.props.closeModal && this.props.closeModal()} // 调用父组件的 close 方法
             cancelText="取消"
             okButtonProps={{ style: { display: 'none' } }} // Remove the OK button
             destroyOnClose
            >
              <EditUsersFrom data={this.props.data} closeModal={this.props.closeModal}/>
            </Modal>
        </div>)
  }
}
export default EditUesrs;